package com.example.demo03;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

public class XmlAdvice {
    public void before(JoinPoint joinPoint){
        System.out.println("这是前置通知");
        System.out.println("joinPoint.getTarget():"+joinPoint.getTarget());
        System.out.println("joinPoint.getSignature():"+joinPoint.getSignature().getName());
    }
    public void afterReturning(JoinPoint joinPoint){
        System.out.println("这是后置通知");
        System.out.println("joinPoint.getSignature():"+joinPoint.getSignature().getName());
    }
    public Object around(ProceedingJoinPoint point) throws Throwable {
        System.out.println("这是环绕通知之前");
        Object object=point.proceed();
        System.out.println("这是环绕通知之后");
        return object;
    }
    public void afterException(){
        System.out.println("异常通知");
    }
    public void after(){
        System.out.println("后置通知");
    }
}
